if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_Khachhang_KhachHangNhaCungCap_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_Khachhang_KhachHangNhaCungCap_Update]
GO
CREATE PROC [sp_Khachhang_KhachHangNhaCungCap_Update]
	@Id						int,
	@Ten					nvarchar(50),
	@Ma_khu_vuc				int,
	@Ma_nhom_khach_hang			int,
	@Dia_chi				nvarchar(500),
	@Tel					nvarchar(40),
	@Fax					nvarchar(40),
	@Email					nvarchar(50),
	@So_tai_khoan			nvarchar(40),
	@Ngan_hang				nvarchar(40),
	@Ma_so_thue				varchar(40),
	@Ghi_chu				nvarchar(100)

AS
BEGIN
	
	
		
	UPDATE khachhang
		SET
					Ten = @Ten,
					Ma_khu_vuc = @Ma_khu_vuc,
					Ma_nhom_khach_hang = @Ma_nhom_khach_hang,
					Dia_chi = @Dia_chi,
					Tel = @Tel,
					Fax = @Fax,
					Email = @Email,
					So_tai_khoan = @So_tai_khoan,
					Ngan_hang = @Ngan_hang,
					Ma_so_thue = @Ma_so_thue,
					Ghi_chu = @Ghi_chu,
					Ngay_cap_nhat_cuoi = getdate()
		where 			id = @Id
END